#include "reg52.h"

void InitHC573(unsigned char channel)
{
	switch(channel)
	{	
		case 4:
			P2 = (P2&0x1f) | 0x80;
			break;
			case 5:
			P2 = (P2&0x1f) | 0xa0;
			break;
			case 6:
			P2 = (P2&0x1f) | 0xc0;
			break;
			case 7:
			P2 = (P2&0x1f) | 0xe0;
			break;
			case 0:
			P2 &=0x1f;
			break;
		}
}

void Sys_Init()
{
	InitHC573(4);
	P0 = 0xff;
	InitHC573(0);
	
	InitHC573(5);
	P0 = 0x00;
	InitHC573(0);
	
}
